<!DOCTYPE html>
<html>
<head>
    <title>测试用例选择</title>
</head>
<link href="/bower_components/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="/static/css/controls.css" rel="stylesheet" type="text/css">
<script>var ctx = '';
var basePath = '/grule-manager';
</script>

<script src="/bower_components/requirejs/require.js" data-main="/static/app.js"
        data-bootstrap-modules="'system2/execute/PublishController'"></script>
<body ng-controller="PublishController" ng-cloak>

<g-data-source url="/grule-manager/rulePackage/unitCase" data-params="search" data-source-name="unitCaseSource"
               page="true" allow-auto-load="true"></g-data-source>
<g-data-source url="/grule-manager/rulePackage/getVersions" data-params="search" data-source-name="VersionSource"
               allow-auto-load="true" page="true" records-prop="data.records" total-record-prop="data.totalRecord" total-page-field = "data.totalPage"> </g-data-source>
<div class="container">
    <div class="page-header">
        <h4>[{{mes.projectName}}]-
            <small>{{mes.packageName}}</small>
        </h4>
    </div>
    <div class="row">
        <div class="col-xs-2">发布版本:</div>
        <div class="col-xs-8">
            <label class="radio-inline">
                <input type="radio" checked="true" value="now" name="version"
                       ng-click="showVersion(1)"/>当前版本
            </label>
            <label class="radio-inline">
                <input type="radio" value="history" name="version"
                       ng-click="showVersion(2)"/>历史版本
            </label>
        </div>
    </div>
    <div class="row" ng-show="nowVersion">
        <div class="col-xs-2">版 &nbsp;本&nbsp; 号:</div>
        <div class="col-xs-2">{{mes.version}}</div>
        <br>
        <div class="col-xs-2">当前状态:</div>
        <div class="col-xs-2">{{packageStatus}}</div>
        <br>
        <div class="col-xs-2">当前用例:</div>
        <div class="col-xs-10">
            <g-data-grid data-source-name="unitCaseSource" data-checked-rows="selectRows"
                         ng-cloak>
                <g-column width="" data="unitCaseName">用例名称</g-column>
            </g-data-grid>
            <button class="btn btn-default " ng-click="confirm()"><span class="glyphicon glyphicon-play"></span>&nbsp;&nbsp;发布
            </button>
        </div>
    </div>
    <div class="row" ng-show="historyVersion">
        <div class="col-xs-11">
            <g-data-grid data-source-name="VersionSource" >
                <g-column width="15%" align="center" data="version">
                    版本号
                </g-column>
                <g-column align="center" data="remark">
                    版本描述
                </g-column>
                <g-column align="center" data="status | statusFilter">
                    状态
                </g-column>

                <g-column width="15%" align="center">
                    操作
                    <g-column-tmpl>
                        <a href="javascript:" ng-click="hisPublish(row)"><span class="glyphicon glyphicon-remove"
                                                                               aria-hidden="true"></span>&nbsp;&nbsp;发布</a>
                    </g-column-tmpl>
                </g-column>
            </g-data-grid>
            <g-pagination-navi source-name="VersionSource"></g-pagination-navi>
        </div>

    </div>
</div>
<div>
</div>

</body>
</html>
